package com.pswv2.backstage.more.user_messages.action;


import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pswv2.backstage.more.authentication.servic.AuthenticationService;
import com.pswv2.bub.bsc.dao.po.User;
import com.pswv2.bub.bsc.dao.po.UserMessages;
import com.pswv2.util.CommonResp;
import com.pswv2.util.ExtraSpringHibernateTemplate;

@Controller
@RequestMapping(value = "userMessagesAction", produces = { "text/json;charset=UTF-8" })
public class UserMessagesAction {
	
	private static Class<?> poc = UserMessages.class;
	private static Class<?> pocU = User.class;
	@Autowired
	private ExtraSpringHibernateTemplate extraSpringHibernateTemplate;
	@Autowired
	private AuthenticationService authenticationService;
	
	/**
	 * 是否已上传过认证
	 */
	@ResponseBody
	@RequestMapping(value = "appAdd")
	public String appAdd(Integer userId,String userMessages,String userTitle) {
		long sendTime=new Date().getTime();
		UserMessages um=new UserMessages();
		um.setUserMessages(userMessages);		
		um.setUserId(userId);
		um.setUserTitle(userTitle);
		um.setSendTime(sendTime);
		extraSpringHibernateTemplate.getHibernateTemplate().save(um);
		return CommonResp.buildSuccessResp().toJsonString();
	}
	
}
